package org.ws.edu.task2;

import java.util.TreeSet;

public class Element implements IElement, Comparable {
    public TreeSet<Element> elements;
    private boolean isFolder = false;
    private String name = null;

    public Element(String name, Boolean isFolder) {
        this.name = name;
        this.isFolder = isFolder;
        elements = new TreeSet<Element>();
    }

    @Override
    public boolean isFolder() {
        return isFolder;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public int compareTo(Object obj) {
        return name.compareTo(((Element) obj).name);
    }

    @Override
    public String toString() {
        return this.name;
    }
}
